﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcApplication1.Models;

namespace MvcApplication1.Controllers
{
    public class ProductController : Controller
    {
        //
        // GET: /Product/

        public ActionResult List(string category, int? page)
        {
            List<Person> listOfPersons =
                new List<Person>(){ new Person { firstName = "one", lastName = "one - last name"},
                    new Person { firstName ="two", lastName= "two - last name" }
                };

            if (category != null)
                ViewData["i"] = category + page.ToString();
            else
                ViewData["i"] = "No category passed " + page.ToString();

            return View(listOfPersons);
        }

        public ActionResult List1(Person person)
        {
            return View(person);
        }
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult List1(int? pid, Person person)
        {
            return View(person);
        }
        public string List2(string firstName, string lastName)
        {
                return "found";
        }

        public ViewResult Edit(int id, Person p)
        {
            return View(p);
        }
    }
}
